<!DOCTYPE html>
{% load i18n %}
{% load static %}
<html>
<head>
    {% block meta %}
    {% endblock meta %}
    <meta charset="UTF-8">
    <meta name="viewport" content="width=1040">
{#    <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width"/>#}
    <!-- Latest compiled and minified CSS -->
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" crossorigin="anonymous">

    <!-- Latest compiled and minified JavaScript -->
    <script src="https://code.jquery.com/jquery-3.2.1.min.js" crossorigin="anonymous"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" crossorigin="anonymous"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" crossorigin="anonymous"></script>

    <link href="https://fonts.googleapis.com/css?family=Exo+2" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">

    <script src="{% static 'main/script/bazo.js' %}"></script>
    <link href="{% static 'main/style/bazo.css' %}" rel="stylesheet">
    <link href="{% static 'main/style/bazo_b.css' %}" rel="stylesheet">
    <link href="{% static 'komunumoj/style/komunumo.css' %}" rel="stylesheet">
    <link href="{% static 'uzantoj/style/uzantoj.css' %}" rel="stylesheet">

    {% block css_js %}
    {% endblock css_js %}

    <title>{% block title %}{% endblock title %} — {% trans 'Teknokomo' %}</title>
    <!-- Matomo -->
    <script type="text/javascript">
        var _paq = _paq || [];
        /* tracker methods like "setCustomDimension" should be called before "trackPageView" */
        _paq.push(['trackPageView']);
        _paq.push(['enableLinkTracking']);
        (function() {
            var u="//analitiko.tehnokom.su/";
            _paq.push(['setTrackerUrl', u+'piwik.php']);
            _paq.push(['setSiteId', '1']);
            var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
            g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
        })();
    </script>
    <!-- End Matomo Code -->
</head>
<body>
<header>
{#<div class="container-fluid">#}
{#    <div class="row justify-content-around">#}
{#    <nav class="navbar navbar-expand-md navbar-light bg-light">#}
{#        <a class="navbar-brand" href="/">#}
{#            <img src="{% static 'main/images/logo.png' %}" alt="{% trans 'Teknokomo' %}">#}
{#        </a>#}
{#        <form action="{% url 'search' %}" method="get" class="form-inline my-2">#}
{#                {{ search_form.search_field }}#}
{#                <button type="submit" class="btn my-2">Поиск</button>#}
{#        </form>#}
{#        <ul class="navbar-nav mr-auto">#}
{#            <li class="nav-item">#}
{#                <a href="/" id="poehali" class="nav-link">{% trans 'Poehali!' %}</a>#}
{#            </li>#}
{#            <li class="nav-item">#}
{#                {% if a_uzanto.is_admin %}#}
{#                    <a href="/eduko" id="eduko" class="nav-link">{% trans 'Scioj' %}</a>#}
{#                    {% else %}#}
{#                    <a href="#" id="eduko" class="nav-link disabled">{% trans 'Scioj' %}</a>#}
{#                {% endif %}#}
{#            </li>#}
{#            <li class="nav-item">#}
{#                {% if a_uzanto.is_admin %}#}
{#                    <a href="/wiki" id="enciklopedio" class="nav-link">{% trans 'Enciklopedio' %}</a>#}
{#                    {% else %}#}
{#                    <a href="#" id="enciklopedio" class="nav-link disabled">{% trans 'Enciklopedio' %}</a>#}
{#                {% endif %}#}
{#            </li>#}
{#            <li class="nav-item">#}
{#                {% if a_uzanto.is_admin %}#}
{#                    <a href="/pm" id="mesagxilo" class="nav-link">{% trans 'Mesaĝilo' %}</a>#}
{#                {% else %}#}
{#                    <a href="#" id="mesagxilo" class="nav-link disabled">{% trans 'Mesaĝilo' %}</a>#}
{#                {% endif %}#}
{#            </li>#}
{#            <li class="nav-item dropdown">#}
{#                <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">#}
{#                    Dropdown#}
{#                </a>#}
{#            </li>#}
{#        </ul>#}
{#    </nav>#}
{#        </div>#}
{#</div>#}
    <div class="m-navbar">
        <div class="nav-shadow">
            <div class="nav-cont">
                <div class="nav-logo">
                    <a href="/" class="nav-logo">
                        <img src="{% static 'main/images/logo.png' %}" alt="{% trans 'Teknokomo' %}">
                    </a>
                </div>
{#            {% if a_uzanto.is_admin %}#}
{#                <div class="nav-search">#}
{#                    <form role="search" method="get" id="searchform" class="searchform" action="https://tehnokom.su/">#}
{#                        <label class="screen-reader-text" for="s"></label>#}
{#                        <input type="text" value="" name="s" id="s" class="ui-autocomplete-input" autocomplete="off">#}
{#                    </form>#}
{#                </div>#}
{#            {% else %}#}
{#                <div class="nav-search-malakt">#}
{#                    <form role="search" method="get" id="searchform" class="searchform" action="https://tehnokom.su/">#}
{#                        <label class="screen-reader-text" for="s"></label>#}
{#                        <input type="text" value="" name="s" id="s"  class="ui-autocomplete-input" autocomplete="off" placeholder="Поиск временно отключен" disabled>#}
{#                    </form>#}
{#                </div>#}
{#            {% endif %}#}
                <form action="{% url 'search' %}" method="get" role="search">
                    <div class="nav-search">
                        {{ search_form.search_field }}
{#                        <button type="submit">Поиск</button>#}
                    </div>
                </form>
                <div class="nav-right">
                    <a href="/"><div id="poehali" class="nav-item">{% trans 'Poehali!' %}</div></a>
                    <a href="/wiki"><div id="enciklopedio" class="nav-item">{% trans 'Enciklopedio' %}</div></a>
                    <a href="/im"><div id="mesagxilo" class="nav-item">{% trans 'Mesaĝilo' %}</div></a>
                    {% if user.is_authenticated %}
                    <div id="person" class="nav-name">
                        <span>{{ a_uzanto.unua_nomo__enhavo }}</span>
                        <div class="nav-ava">
                        {% if a_uzanto.fotoj_fotojuzantojavataro_posedanto__bildo_min %}
                            <img class="in-ava" src="/media/{{ a_uzanto.fotoj_fotojuzantojavataro_posedanto__bildo_min }}">
                        {% else %}
                            {% if user.sekso == 'vira' or user.sekso is None %}
                                <img class="in-ava" src="{% static 'main/images/vira-avataro-min.png' %}">
                            {% elif user.sekso == 'virina' %}
                                <img class="in-ava" src="{% static 'main/images/virina-avataro-min.png' %}">
                            {% endif %}
                        {% endif %}
                        </div>
                    </div>
                    {% else %}
                    <div id="person" class="nav-name">
                        <span>{% trans 'Ensaluti' %}</span>
                        <div class="nav-ava">
                            <img class="in-ava" src="{% static 'main/images/login-avatar.png' %}">
                        </div>
                    </div>
                    {% endif %}
                </div>
            </div>
        </div>
    </div>

</header>
<main>
{#<div class="container container-fix">#}
    {% block main %}
        <div class="main-container">
        {% if user.is_authenticated %}
            <div class="open-menu">
                <a href="/idu{{ user.id }}"><div class="drop-item">{% trans 'Mia planedo' %}</div></a>
                <div class="drop-line"></div>
            {% if a_uzanto.is_admin %}
                <a href="#"><div class="drop-item">{% trans 'Sciigoj' %}</div></a>
                {% else %}
                <a href="#"><div class="drop-item-malakt">{% trans 'Sciigoj' %}</div></a>
            {% endif %}
                <a href="/agru{{ user.id }}"><div class="drop-item">{% trans 'Agordoj' %}</div></a>
                <a href="/p5/"><div class="drop-item">{% trans 'Helpo' %}</div></a>
                <div class="drop-line"></div>
                <a href="{% url 'registrado:elsaluti' %}"><div class="drop-item">{% trans 'Elsaluti' %}</div></a>
            </div>
            <div class="left-side">
                <aside class="g_grid__sidebar" data-role="desktop_menu">
                    <div class="menu-1-container">
                        <ul id="menu-1" class="menu">
                            <li id="home" class="menu-item home"><a href="/idu{{ user.id }}">{% trans 'Mia planedo' %}</a></li>
{#                          <li id="newspaper" class="menu-item newspaper"><a href="/nov{{ user.id }}">{% trans 'Novaĵoj' %}</a></li>#}
                            <li id="newspaper" class="menu-item newspaper"><a href="/novayoj">{% trans 'Novaĵoj' %}</a></li>
                            <li id="person" class="menu-item person"><a href="/kmr">{% trans 'Gekamaradoj' %}</a></li>
                            <li id="speaker" class="menu-item speaker"><a href="/socio">{% trans 'Komunumoj' %}</a></li>
{#                            <li id="hammer" class="menu-item hammer"><a href="/lab{{ user.id }}">{% trans 'Laboro' %}</a></li>#}
                            <li id="hammer" class="menu-item hammer"><a href="#">{% trans 'Laboro' %}</a></li>
                            <li id="heart" class="menu-item heart"><a href="/sano{{ user.id }}">{% trans 'Sano' %}</a></li>
{#                            <li id="heart" class="menu-item heart"><a href="#">{% trans 'Sano' %}</a></li>#}
{#                            <li id="play" class="menu-item play"><a href="/tenu{{ user.id }}">{% trans 'Tenejo' %}</a></li>#}
                            <li id="play" class="menu-item play"><a href="#">{% trans 'Tenejo' %}</a></li>
                        </ul>
                    </div>

                    <div class="menu-2-container">
                        <ul id="menu-2" class="menu">
                            <li id="dikretumo" class="menu-item dikretumo"><a href="#">{% trans 'Dekretumoj' %}</a></li>
                            <li id="trophy" class="menu-item trophy"><a href="/premioj">{% trans 'Premioj' %}</a></li>
                            <li id="document" class="menu-item document"><a href="#">{% trans 'Dokumentoj' %}</a></li>
                            <li id="bookmark" class="menu-item bookmark"><a href="#">{% trans 'Legosignoj' %}</a></li>
                            <li id="gamepad" class="menu-item gamepad"><a href="#">{% trans 'Ludoj' %}</a></li>
                        </ul>
                    </div>
                </aside>
            </div>
            {% else %}
            <div class="open-menu">
                <form method="POST" action="{% url 'registrado:ensaluti' %}">
                    {% csrf_token %}
                    {{ registrado_formo.as_p }}
                    <button class="submit" id="registrado_selection_submit" style="width: 100%;">{% trans 'Ensaluti' %}</button>
                    <a href="{% url 'registrado:restarigo' %}">{% trans 'Renovigi aliron' %}</a> | <a href="{% url 'registrado:registrado' %}">{% trans 'Registrado' %}</a>
                </form>
            </div>
            <div class="left-side">
                <aside class="g_grid__sidebar" data-role="desktop_menu">
                    <div class="menu-1-container">
                        <ul id="menu-1" class="menu">
                            <li id="home" class="menu-item home"><a href="/p5/">{% trans 'Informo' %}</a></li>
                        </ul>
                    </div>
                </aside>
            </div>
            {% endif %}
            <div class="main-side">
                {% block main_side %}
                {% endblock main_side %}
            </div>
        </div>
    {% endblock main %}
{#</div>#}
</main>
<div style="display: none">
{% block hidden_blocks %}
{% endblock %}
</div>
</div>
</body>
</html>